<%-- 
    Document   : add_student_post
    Created on : Nov 24, 2011, 8:18:50 PM
    Author     : THIENSUHACK
--%>

<%@page import="GetData.CharsetFilter"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="dktc_ws.Quantri"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
 request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html; charset=UTF-8"); 
    //CharsetFilter ab=new CharsetFilter();
    if(request.getParameter("manguoidung")==null)
               {
        response.sendRedirect("/DKTC/admin/index.jsp?page=list_account");
        return;
    }
    
    Quantri account = new Quantri();
    account.setManguoidung(Integer.parseInt(request.getParameter("manguoidung").trim()));
    account.setTendangnhap(request.getParameter("tendangnhap"));
    account.setMatkhau(request.getParameter("matkhau"));
    account.setEmail(request.getParameter("email"));

    int result=0;
   DataWS a=new DataWS();
   
      //account.setTuade(ab.toUTF8(account.getTuade()));
   //account.setMotangan(ab.toUTF8(account.getMotangan()));
   //account.setNoidung(ab.toUTF8(account.getNoidung()));
   
   result=a.suataikhoan(account.getManguoidung(),account.getTendangnhap(),account.getEmail(),account.getMatkhau());
   if(result>0)
             {
       out.print("thanh cong");
       response.sendRedirect("/DKTC/admin/index.jsp?page=list_account");
   }
   else
       out.print("that bai");
           %>
           <div><a href="/DKTC/admin/index.jsp?page=list_account">Xem danh sách tin tức</a> | <a href="/DKTC/admin/index.jsp?page=add_account">Thêm Tin Mới</a></div>